package com.anosine.gpsl.android.util.ormdb;

import java.io.File;
/**
 * @Title: DBConfig
 * @Package com.anosine.gpsl.android.util.ormdb
 * @Description: 
 * @author: sunny
 * @date: 2015-11-23
 * @version V1.0
 */

public class DBConfig {
	/** 数据库设置 **/
	public static final class DATABASE {
		public static final int VERSION = 1;// 版本
		public static final String PATH = "/data/data/com.anosine.gpsl.android/";
	}
	

	public static boolean isDBFileExist() {
		String path = DBConfig.DATABASE.PATH + "databases" + File.separator;
		String DB_NAME = path + "DB4.db";
		File file = new File(DB_NAME);
		long length = file.length();
		if (file.exists()) {
			if (length < 10240) {
				file.delete();
				return false;
			}
			return true;
		} else {
			return false;
		}
	}

	public static String getFilePath() {
		String path = DBConfig.DATABASE.PATH + "databases" + File.separator;
		String DB_NAME = path + "DB4.db";
		File dir = new File(path);
		if (!dir.exists()) {
			dir.mkdirs();
		}
		return DB_NAME;
	}

}
